package edu.hubu.supermarketmanagementsystem.vo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class ResultVO<T> {
    private int code;
    private String msg;
    private T data;

    public static <T> ResultVO<T> success(T data) {
        return new ResultVO<>(200, "Success", data);
    }

    public static <T> ResultVO<T> error(int code, String msg) {
        return new ResultVO<>(code, msg, null);
    }
}
